package cn.wolfcode.trip.app.controller;

import cn.wolfcode.trip.base.query.InfomationQueryObject;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.IInformationService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/informations")
public class InformationController {

    @Autowired
    private IInformationService dailyService;
    //查询消息
    @GetMapping("{userId}")
    public PageInfo listDailies(InfomationQueryObject qo) {
        qo.setOrderBy("info.createTime desc");
        PageInfo pageInfo = dailyService.query(qo);
        return pageInfo;
    }

}
